package com.vincent.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by vincent on 11/8/14.
 */
public class DateUtil {

    private static final String []DATEFORMAT_PATTERN = {"yyyy-MM-dd HH:mm:ss"};

    public static String dateToString(Date date,int index){
        AssertUtil.isTrue(index<DATEFORMAT_PATTERN.length);
        SimpleDateFormat FORMAT=new SimpleDateFormat(DATEFORMAT_PATTERN[index]);
        return FORMAT.format(date);
    }

}
